//
//  IWWalletCell.m
//  WWallet
//
//  Created by Aries on 11-9-26.
//  Copyright 2011年 bit. All rights reserved.
//

#import "IWWalletCell.h"


@implementation IWWalletCell

@synthesize primaryLabel,secondaryLabel,mainImage;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        primaryLabel = [[UILabel alloc]init];
        primaryLabel.textAlignment = UITextAlignmentLeft;
        primaryLabel.font = [UIFont systemFontOfSize:14];
        //primaryLabel.backgroundColor = [UIColor redColor];
        
        secondaryLabel = [[UILabel alloc]init];
        secondaryLabel.textAlignment = UITextAlignmentLeft;
        secondaryLabel.font = [UIFont systemFontOfSize:10];
        secondaryLabel.textColor = [UIColor grayColor];
        //secondaryLabel.backgroundColor = [UIColor blueColor];
        
        mainImage = [[UIImageView alloc] init];
        
        [self.contentView addSubview:primaryLabel];
        [self.contentView addSubview:secondaryLabel];
        [self.contentView addSubview:mainImage];
    }
    return self;
}

-(void) layoutSubviews
{
    [super layoutSubviews];
    CGRect contentRect = self.contentView.bounds;
    CGFloat boundsX = contentRect.origin.x;
    CGRect frame;
    
    frame= CGRectMake(boundsX+50 ,5, 220, 24);
    primaryLabel.frame = frame;
    
    frame= CGRectMake(boundsX+50 ,29, 220, 16);
    secondaryLabel.frame = frame;
    
    frame=CGRectMake(boundsX+5, 7, 32, 32);
    mainImage.frame = frame;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


- (void)willTransitionToState:(UITableViewCellStateMask)state
{
    
	[super willTransitionToState:state];
    
	if ((state & UITableViewCellStateShowingDeleteConfirmationMask) == UITableViewCellStateShowingDeleteConfirmationMask)
	{
    }
}

- (void)dealloc
{
    [super dealloc];
}

@end
